<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>层级选择器</title>
		<link rel="stylesheet" href="style.css">
		<script src="../../js/jquery-1.11.0.min.js"></script>
		<script>
			$(function (){
				$("#btn1").click(function (){
					$("body div").css("background-color","red");
				});

				$("#btn2").click(function (){
					$("body>div").css("background-color","pink");
				});

				$("#btn3").click(function (){
					$("#two+div").css("background-color","green");
				});

				$("#btn4").click(function (){
					$("#one~div").css("background-color","yellow");
				});

				$("#btn5").click(function () {
					$("*").css("background-color","");
				});
			});
		</script>
	</head>
	<body>
		<input type="button" id="btn1" value="选择body中的所有的div元素"/>
		<input type="button" id="btn2" value="选择body中的第一级的孩子"/>
		<input type="button" id="btn3" value="选择id为two的元素的下一个元素"/>
		<input type="button" id="btn4" value="选择id为one的所有的兄弟元素"/>
		<input type="button" id="btn5" value="清除所有效果"/>

		<hr/>
		<div id="one">
			<div class="mini">
				111
			</div>
		</div>
		
		<div id="two">
			<div class="mini">
				222
			</div>
			<div class="mini">
				333
			</div>
		</div>
		
		<div id="three">
			<div class="mini">
				444
			</div>
			<div class="mini">
				555
			</div>
			<div class="mini">
				666
			</div>
		</div>
		
		<span id="four">
			
		</span>
	</body>
</html>
